@extends('admin.layout')
@section('title',$title)
@section('content')
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                文章管理
                <small>文章操作页面</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>文章管理</a></li>
                <li class="active">文章列表</li>
            </ol>
        </section>
        @if(session('success'))
            <div class="alert alert-danger">
                {{session('success')}}
            </div>
        @endif

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">文章列表</h3>
                        </div><!-- /.box-header -->
                        <div class="box-body">
                        
                            <table id="example2" class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>文章名称</th>
                                    <th>文章图片</th>
                                    <th>文章作者</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($data as $v)
                                <tr>
                                    <td>{{$v -> id}}</td>
                                    <td>{{$v -> title}}</td>
                                    <td><img src="{{$v -> img}}" width="50" height="50"></td>
                                    <td>{{$v -> author}}</td>
                                    <td><a style="float:left" href="/admin/article/{{$v -> id}}/edit" class="btn bg-maroon margin">编辑</a>
                                    <form style="float:left" action="/admin/article/{{$v -> id}}" method="post">
                                        {{csrf_field()}}
                                        {{method_field('DELETE')}}
                                        <button class="btn bg-maroon margin">删除</button>
                                    </form>
                                    </td>
                                </tr>
                                @endforeach
                                </tbody>
                              
                            </table>
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
    
@endsection
